package com.cjhhv.base.util;


import com.cjhhv.base.model.BaseModel;
import com.github.pagehelper.ISelect;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

public class PageUtil {

    public static <E> PageInfo<E> createPageQuery(int pageNum, int pageSize, ISelect select) {
        return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(select);
    }

    public static <E> PageInfo<E> createPageQuery(BaseModel baseModel, ISelect select) {
        return PageHelper.startPage(baseModel.getPageNum(), baseModel.getPageSize()).doSelectPageInfo(select);
    }
}
